<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'el.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body> 
    uThis is my JSP page. <br>
    <%out.println("传递参数时，el表达式也可以取session和上下文对象的参数，当session里的key和request里的key相同时，可以用sessionScope") ;%>
    <%out.println("若不这样则默认取request里的key，如下"); %><br/>
    ${session}<br/>
    ${name}<br/>
     ${sessionScope.name}<br/>
     ${application}<br/>
     
    <%out.println("el表达式等同于request.getparameter(属性名)"); %><br/>
    <%out.println("el表达式与JSTL表达式一起使用"); %>
    <c:forEach items="${buildings}" var="build">
       ${build.building_name}
       ${build.building_remark}${build.building_remark==""||build.building_remark==null}<br/><hr/>
       
    </c:forEach>
    <br/>
    <%out.println("param属性的到路径里的键值对") ;%>
    
    ${param}<br/><%out.println("只取路径里面键值对的value:"); %>
    ${param.name }<br/>
    <%out.println("当多个参数时用ParamValues"); %>
    ${paramValues["color"][1] }
    ${paramValues["color"][0] }
    ${paramValues["name"][0] }<br/><hr/>
    ${header }<br/>
	${header.cookie}    <br/>
	${headerValues["cookie"][0] }<br/><hr/>
	<%out.println("读取初始化参数"); %>
	${initParam.username }
	<%=application.getInitParameter("username") %><br/>
	${pageContext }<br/>
    ${pageContext.request }<br/>
    ${pageContext.request.queryString }<br/>
    <%out.println("当单个禁用EL表达式时前面加反斜杠 即可"); %>
    
    ${pageScope.name }
    
    
  </body>
</html>
